//
//  DCStatusView.m
//  Demo
//
//  Created by zhaolin on 2023/2/3.
//

#import "DCStatusView.h"


@interface DCStatusView ()

@property (nonatomic, strong) UILabel *desLabel;

@end

@implementation DCStatusView

- (instancetype)initWithFrame:(CGRect)frame type:(DCStatusViewType)type {
    self = [super initWithFrame:frame];
    if (self) {
        [self configureUI];
    }
    return self;
}

- (void)configureUI {
    self.backgroundColor = [UIColor clearColor];
    _desLabel = [UILabel new];
    _desLabel.textColor = [UIColor colorWithString:@"#1C221B"];
    _desLabel.font = DCFont_PF_Medium(16);
    _desLabel.numberOfLines = 0;
    _desLabel.textAlignment = NSTextAlignmentCenter;
    _desLabel.width = kScreenWidth - 20;
    _desLabel.height = 60;
    _desLabel.center = self.center;
    [self addSubview:_desLabel];
}

- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
    NSArray *subViews = [self subviews];
    for (UIView *subView in subViews) {
        CGPoint childPoint = [self convertPoint:point toView:subView];
        UIView *view = [subView hitTest:childPoint withEvent:event];
        return view;
    }
    if (self.alpha == 0 || self.backgroundColor == [UIColor clearColor]) {
        return nil;
    }
    return self;
}
/**
 TODO:设置描述

 @param desString 描述文本
 */
- (void)setLabelDes:(NSString *)desString {
    _desLabel.text = desString;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
